home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Viaggio in Francia
/
Viaggio in Francia.iso
/
SETFILES
/
SETUP.MST
< prev
next >
Wrap
Text File
|
1995-10-24
|
12KB
|
435 lines
'**************************************************************************
'* MSSetup Telemedia
'**************************************************************************
'$DEFINE DEBUG ''Define for script development/debugging
'$INCLUDE 'setupapi.inc'
'$INCLUDE 'msdetect.inc'
'$INCLUDE 'setst.inc'
''Dialog ID's
CONST ASKQUIT = 200
CONST DESTPATH = 300
CONST EXITFAILURE = 400
CONST EXITQUIT = 600
CONST EXITSUCCESS = 700
CONST OPTIONS = 800
CONST APPHELP = 900
CONST RESTART = 2600
CONST RESTARTII = 2700
CONST CUSTINST = 6200
CONST TELEINST = 6250
CONST TOOBIG = 6300
CONST BADPATH = 6400
''Bitmap ID
CONST LOGO = 1
''File Types
CONST APPFILES = 1
CONST OPTFILES1 = 2
CONST OPTFILES2 = 3
GLOBAL SRCDIR$
GLOBAL DEST$ ''Default destination directory.
GLOBAL WINDRIVE$ ''Windows drive letter.
GLOBAL WINDIR$
GLOBAL WINSYSDIR$
GLOBAL TBKDIR$
GLOBAL SndDIR$
GLOBAL SndZiel$
GLOBAL TBKDEST$
GLOBAL NEEDET&
GLOBAL DRVSPACE&
GLOBAL tb15Path$
'' Driver
CONST ADDVFW = 1
GLOBAL VFWPATH$
''CustInst list symbol names
''Dialog list symbol names
GLOBAL STATUSTEXT$
GLOBAL DRIVETEXT$
DECLARE SUB BuildCopyList
DECLARE SUB CalculateCopyList
DECLARE SUB SetDriveStatus
DECLARE SUB RegisterEntries
DECLARE SUB CreateIniEntries
DECLARE SUB SetupProgman
DECLARE FUNCTION MakePath (szDir$, szFile$) AS STRING
DECLARE FUNCTION OnWindowsNT LIB "INIUPD.DLL" AS INTEGER
DECLARE FUNCTION VflatdPresent LIB "iniupd.DLL" AS INTEGER
DECLARE SUB Reboot LIB "iniupd.dll"
DECLARE fUNCTION ExitWindowsExec LIB "User" (Exec$, Param$) AS INTEGER
TRAP CleanupTrap From "MSSHLSTF.DLL"
End Trap
Inst% = HinstFrame()
ii% = CreateCover(0, 0, 0, 0, 0)
ret% = Ctl3dRegister(Inst%)
ret% = Ctl3dAutoSubClass(Inst%)
hSetup = InitSetup(COMMAND$)
hWnd% = HwndFrame()
ret% = SubSetMainWin(hWnd%)
ii% = CloseCover()
WIN32ENABLED% = 0
MajorVer% = GetWindowsMajorVersion()
MinorVer% = GetWindowsMinorVersion()
IF MajorVer% < 3 OR (MajorVer% = 3 AND MinorVer% < 10) THEN
i% = DoMsgBox("E' richiesto Microsoft Windows versione 3.10 o successiva", "Problema d'installazione", MB_OK+MB_TASKMODAL+MB_ICONHAND)
END
END IF
IF DeviceColor() <= 256 THEN
ii% = DoMsgBox("Il video deve essere regolato per almeno 32.000 colori", "Hardware", MB_OK)
GOTO QUIT
END IF
ON ERROR GOTO QUIT
INIT:
CUIDLL$ = "mscuistf.dll" ''custom user interface dll
HELPPROC$ = "FHelpDlgProc" ''Help dialog procedure
SetTitle "Viaggio in Francia"
VFWPATH$ = "VFW\"
szInf$ = GetSymbolValue("STF_SRCINFPATH")
IF szInf$ = "" THEN
szInf$ = GetSymbolValue("STF_CWDDIR") + "SETUP.INF"
END IF
ReadInfFile szInf$
WINDRIVE$ = UCASE$(MID$(GetWindowsDir, 1, 1))
DEST$ = WINDRIVE$ + ":\France"
WINDIR$ = GetWindowsDir()
WINSYSDIR$ = GetWindowsSysDir()
''CustInst list symbols
STATUSTEXT$ = "StatusItemsText"
DRIVETEXT$ = "DriveStatusText"
FOR i% = 1 TO 3 STEP 1
AddListItem STATUSTEXT$, ""
NEXT i%
FOR i% = 1 TO 2 STEP 1
AddListItem DRIVETEXT$, ""
NEXT i%
ReplaceListItem DRIVETEXT$, 2, DEST$
SetDriveStatus
CUSTINST:
sz$ = UIStartDlg(CUIDLL$, TELEINST, "FTeleInstDlgProc", APPHELP, HELPPROC$)
IF sz$ = "CONTINUE" THEN
''Install only if it will fit.
BuildCopyList
CalculateCopyList
IF NEEDET& <> 0 THEN
GOSUB TOOBIG
GOTO CUSTINST
END IF
UIPop 1
GOTO INSTALL
ELSEIF sz$ = "PATH" THEN
GOTO GETPATH
ELSEIF sz$ = "REACTIVATE" THEN
SetDriveStatus
GOTO CUSTINST
ELSE
GOSUB ASKQUIT
GOTO CUSTINST
END IF
INSTALL:
CreateDir DEST$, cmoNone
BuildCopyList
CopyFilesInCopyList
CreateIniEntries
RegisterEntries
SetupProgman
RESTRT% = RestartListEmpty ()
Exe$ = DEST$ + "\_msrstrt.exe"
Batch$ = DEST$ + "\_mssetup.bat"
empty$ = ""
RESTART:
IF RESTRT% = 0 THEN
sz$ = UIStartDlg(cuidll$, RESTART, "FInfo0DlgProc", 0, "")
IF sz$ = "REACTIVATE" THEN
GOTO RESTART
ENDIF
I% = ExitExecRestart ()
RemoveFile Exe$, cmoForce
RemoveFile Batch$, cmoForce
END
ELSE
sz$ = UIStartDlg(CUIDLL$, RESTARTII, "FQuitDlgProc", 0, "")
IF sz$ = "CONTINUE" THEN
I% = ExitWindowsExec (Exe$, empty$)
IF I% = 0 THEN
GOTO RESTART
ELSE
END
ENDIF
ELSEIF sz$ = "EXIT" THEN
UIPopAll
END
ELSEIF sz$ = "REACTIVATE" THEN
GOTO RESTART
ELSE
UIPop 1
END IF
END IF
QUIT:
''ON ERROR GOTO ERRQUIT
IF ERR = 0 THEN
dlg% = EXITSUCCESS
ELSEIF ERR = STFQUIT THEN
dlg% = EXITQUIT
ELSE
dlg% = EXITQUIT ''EXITFAILURE
END IF
ERRQUIT:
i% = DoMsgBox("VIAGGIO IN FRANCIA non Φ stato installato correttamente", "Errore di installazione", MB_OK+MB_TASKMODAL+MB_ICONHAND)
END
GETPATH:
SetSymbolValue "EditTextIn", DEST$
SetSymbolValue "EditFocus", "END"
GETPATHL1:
sz$ = UIStartDlg(CUIDLL$, DESTPATH, "FEditDlgProc", APPHELP, HELPPROC$)
IF sz$ = "CONTINUE" THEN
olddest$ = DEST$
DEST$ = GetSymbolValue("EditTextOut")
''Validate new path.
IF IsDirWritable(DEST$) = 0 THEN
GOSUB BADPATH
GOTO GETPATHL1
END IF
UIPop 1
''Truncate display if too long.
IF LEN(DEST$) > 23 THEN
ReplaceListItem DRIVETEXT$, 2, MID$(DEST$, 1, 23)+"..."
ELSE
ReplaceListItem DRIVETEXT$, 2, DEST$
END IF
''Recalc if path changed.
IF (olddest$ <> DEST$) AND (olddest$ <> DEST$+"\") AND (olddest$+"\" <> DEST$) THEN
SetDriveStatus
END IF
olddest$ = ""
GOTO CUSTINST
ELSEIF sz$ = "REACTIVATE" THEN
SetDriveStatus
GOTO GETPATHL1
ELSEIF sz$ = "EXIT" THEN
GOSUB ASKQUIT
GOTO GETPATHL1
ELSE
UIPop 1
GOTO CUSTINST
END IF
TOOBIG:
sz$ = UIStartDlg(CUIDLL$, TOOBIG, "FInfo0DlgProc", 0, "")
IF sz$ = "REACTIVATE" THEN
SetDriveStatus
GOTO TOOBIG
END IF
UIPop 1
RETURN
BADPATH:
sz$ = UIStartDlg(CUIDLL$, BADPATH, "FInfo0DlgProc", 0, "")
IF sz$ = "REACTIVATE" THEN
SetDriveStatus
GOTO BADPATH
END IF
UIPop 1
RETURN
ASKQUIT:
sz$ = UIStartDlg(CUIDLL$, ASKQUIT, "FQuitDlgProc", 0, "")
IF sz$ = "EXIT" THEN
UIPopAll
ERROR STFQUIT
ELSEIF sz$ = "REACTIVATE" THEN
GOTO ASKQUIT
ELSE
UIPop 1
END IF
RETURN
SUB CalculateCopyList STATIC
NEEDET& = GetCopyListCost("", "", "")
END SUB
SUB SetupProgman STATIC
'' Todo Add Progman Commands
CreateProgmanGroup "E.M.M.E. MULTIMEDIA", "", cmoOverwrite
ShowProgmanGroup "E.M.M.E. MULTIMEDIA", 1, cmoNone
CreateProgmanItem "E.M.M.E. MULTIMEDIA", "Viaggio in Francia", MakePath(dest$,"france.exe"),MakePath(DEST$,"france.exe"), cmoOverwrite
END SUB
SUB BuildCopyList STATIC
SRCDIR$ = GetSymbolValue("STF_SRCDIR")
TBSRC$ = MakePath(SRCDIR$, TBKDIR$)
sndSRC$ = MakePath(SRCDIR$, sndDIR$)
snddest$ = MakePath(Dest$, SndZiel$)
TBKDEST$ = MakePath(WINDIR$, "asym\runtime\")
source$ = MakePath(srcdir$, "setup\")
ClearCopyList
addsectionFilesToCopyList "WINDO", SOURCE$, WINDIR$
addsectionFilesToCopyList "DEFAULT", SOURCE$, DEST$
''addsectionFilesToCopyList "SISTEM", SOURCE$, WINSYSDIR$
IF ADDVFW <> 0 THEN
'' Video for Windows Files
VFWSRC$= MakePath(SRCDIR$, VFWPATH$)
addsectionFilesToCopyList "VfW Runtime", VFWSRC$, WINSYSDIR$
addsectionFilesToCopyList "OLE2", VFWSRC$, WINSYSDIR$
addsectionFilesToCopyList "ACM Drivers", VFWSRC$, WINSYSDIR$
addsectionFilesToCopyList "MPlayer", VFWSRC$, WINDIR$
addsectionFilesToCopyList "AVICodecs", VFWSRC$, WINSYSDIR$
AddSectionFilesToCopyList "remove", SrcDir$, WinSysDir$
END IF
END SUB
SUB CreateIniEntries STATIC
'' Default Entries
ini$ = MakePath(WINDIR$, "francia.INI")
CreateIniKeyValue WinDir$ + "francia.ini","Path", "principale", srcdir$, cmoOverwrite
valore$ = GetIniKeyString(WinDir$ + "system.ini", "mci", "WaveAudio")
valore$ = LCASE$(MID$(RTRIM$(LTRIM$(valore$)),1,11))
IF valore$ = "mciwave.drv" THEN
CreateIniKeyValue WinDir$ + "system.ini", "mci", "WaveAudio", "mciwave.drv 9", cmoOverwrite
END IF
IF ADDVFW <> 0 THEN
'' Video for Windows Entries
IF VflatdPresent() = 0 THEN
CreateSysIniKeyValue WinDir$ + "system.ini", "386Enh", "device", "dva.386", cmoOverwrite
END IF
CreateIniKeyValue WinDir$ + "system.ini", "Drivers", "VIDC.CVID", "iccvid.drv", cmoOverwrite
CreateIniKeyValue WinDir$ + "system.ini", "Drivers", "VIDC.MSVC", "msvidc.drv", cmoOverwrite
CreateIniKeyValue WinDir$ + "system.ini", "Drivers", "VIDC.IV32", "ir32.dll", cmoOverwrite
CreateIniKeyValue WinDir$ + "system.ini", "Drivers", "VIDC.IV31", "IR32.dll", cmoOverwrite
CreateIniKeyValue WinDir$ + "system.ini", "Drivers", "VIDC.MRLE", "MSRLE.drv", cmoOverwrite
I% = DoesIniKeyExist (WinDir$ + "system.ini", "Drivers", "VIDC.RT21")
IF I% = 0 THEN
CreateIniKeyValue WinDir$ + "system.ini", "Drivers", "VIDC.RT21", "ir21_r.dll", cmoOverwrite
END IF
CreateIniKeyValue WinDir$ + "system.ini", "Drivers", "VIDC.YVU9", "ir21_r.dll", cmoOverwrite
CreateIniKeyValue WinDir$ + "WIN.INI", "mci extensions", "avi", "AVIVideo", cmoOverwrite
CreateIniKeyValue WinDir$ + "system.ini", "mci", "AVIVideo", "mciavi.drv", cmoOverwrite
CreateIniKeyValue WinDir$ + "system.ini", "Drivers", "WaveMapper", "msacm.drv", cmoOverwrite
CreateIniKeyValue WinDir$ + "system.ini", "Drivers", "MSACM.msadpcm", "msadpcm.acm", cmoOverwrite
CreateIniKeyValue WinDir$ + "system.ini", "Drivers", "MSACM.imaadpcm", "imaadpcm.acm", cmoOverwrite
CreateIniKeyValue WinDir$ + "control.ini", "drivers.desc", "msacm.drv", "Microsoft Sound Mapper V2.00", cmoOverwrite
CreateIniKeyValue WinDir$ + "control.ini", "drivers.desc", "msadpcm.acm", "Microsoft ADPCM Codec V2.00", cmoOverwrite
CreateIniKeyValue WinDir$ + "control.ini", "drivers.desc", "imaadpcm.acm", "Microsoft IMA ADPCM Codec V2.00", cmoOverwrite
END IF
END SUB
SUB RegisterEntries STATIC
'' Default Registers
IF ADDVFW <> 0 THEN
'' Video for Windows Entries
Run ("regedit.exe /s " + MakePath(WinDir$, "mplayer.reg"))
Run ("regedit.exe /s " + MakePath(WinSysDir$, "OLE2.reg"))
Run ("regedit.exe /s " + MakePath(WinSysDir$, "cleanup.reg"))
END IF
END SUB
SUB SetDriveStatus STATIC
free& = GetFreeSpaceForDrive(MID$(DEST$, 1, 1))
ReplaceListItem DRIVETEXT$, 1, STR$(free& / 1024) + " K"
END SUB
FUNCTION MakePath (szDir$, szFile$) STATIC AS STRING
IF szDir$ = "" THEN
MakePath = szFile$
ELSEIF szFile$ = "" THEN
MakePath = szDir$
ELSEIF MID$(szDir$, LEN(szDir$), 1) = "\" THEN
MakePath = szDir$ + szFile$
ELSE
MakePath = szDir$ + "\" + szFile$
END IF
END FUNCTION